package dcutils.cards.mtg;

// Import JDK Classes
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
* Represents all the creature types in Magic the Gathering.<br/>
* @author dca
*/
public enum CreatureType implements Iterable<CreatureType> {
	ANGEL("Angel"),
	AVATAR("Avatar"),
	BERSERKER("Berserker"),
	BIRD("Bird"),
	CAT("Cat"),
	CLERIC("Cleric"),
	GIANT("Giant"),
	GRIFFIN("Griffin"),
	HIPPOGRIFF("Hippogriff"),
	HOUND("Hound"),
	KIRIN("Kirin"),
	KITHKIN("Kithkin"),
	HUMAN("Human"),
	MONK("Monk"),
	PEGASUS("Pegasus"),
	SLIVER("Sliver"),
	SOLDIER("Soldier"),
	SPIRIT("Spirit"),
	WALL("Wall"),
	WARRIOR("Warrior"),
	WIZARD("Wizard");

	/** The name of the mana.<br/> */
	private String name;

	/**
	 * The constructor initializes the name.<br/>
	 * @param name The name of the creature type.<br/>
	 */
	private CreatureType(String name) {
		this.name = name;
	} // END constructor

	/**
	 * The getter for the name of the mana.<br/>
	 * @return name The name of the mana.<br/>
	 */
	public String getName() {
		return this.name;
	} // END getName

	/**
	 * Returns an array of all enum values.<br/>
	 * @return CreatureType[] An array of all enum values.<br/>
	 */
	public static CreatureType[] asArray() {
		return values();
	} // END asArray

	/**
	 * Returns a list of all enum values.<br/>
	 * @return List<CreatureType> A list of all enum values.<br/>
	 */
	public static List<CreatureType> asList() {
		return Arrays.asList(asArray());
	} // END asList

	/**
	 * Returns an iterator over all enum values.<br/>
	 * @return Iterator<CreatureType> An iterator over all enum values.<br/>
	 */
	@Override
	public Iterator<CreatureType> iterator() {
		return asList().iterator();
	} // END iterator

	/**
	 * The getter for the name of the mana.<br/>
	 * @return name The name of the mana.<br/>
	 */
	@Override
	public String toString() {
		return getName();
	} // END toString
} // END enum CreatureType
